package com.qf.controller.swagger;

import com.alibaba.druid.sql.visitor.functions.Concat;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/*
杨威
2021/11/3
11:33
*/
@Configuration//配置类
@EnableSwagger2
public class SwaggerConfig {
    @Bean
    public ApiInfo apiInfo(){
        return new ApiInfoBuilder()
                .version("2.1.0.alpha")
                .description("wuyifanzhenghun")
                .title("短信平台")
                .license("apache2.0")//许可
                .licenseUrl("https://www.apache.org/licenses/LICENSE-2.0")//许可地址
                .contact(new Contact("wuyifan","dizhi","wyf@qq.com"))//联系方式
                .build();
    }
    //配置扫描哪个包
    @Bean
    public Docket docket(ApiInfo apiInfo){
        return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo)
                .select().apis(RequestHandlerSelectors.basePackage("com.qf.controller")).build();
    }
}
